(function(){
    var tabs = $('.product-tab');
    var pageSize = 20;
    var currentPage = 1;
	var currentTab = 0; 

    tabs.click(function(e){
    	var current = $(e.target);
    	var index = current.index();
    	if (index != currentTab) {
    		$('.product-page').hide();
    		$('.product-tbody').hide();
    		$('#tbody-' + index).show();
    		$('#page-' + index).show();
    		tabs.removeClass('selected');
    		current.addClass('selected');
    		currentTab = index;
    	}
    });

    new list(data_13, $('#tbody-0'), $("#page-0"));
    new list(data_14, $('#tbody-1'), $("#page-1"));
    new list(data_15, $('#tbody-2'), $("#page-2"));
    new list(data_tfyf, $('#tbody-3'), $("#page-3"));
    new list(data_dsd, $('#tbody-4'), $("#page-4"));

    
    function dealData(str) {//用于处理excel表里的数据为json的工具函数
    	var data = [];
    	var arr = str.split('%');
    	for (var i = 0; i < arr.length; i++) {
    		var obj = {};
    		var item = arr[i].split(' ');
    		obj['date'] = item[0];
    		if (item[1]!=undefined) {
    			var index = item[1].indexOf('-');
    			if (index > -1) {
    				obj['unit'] = item[1].slice(0, index);
    				obj['per'] =  item[1].slice(index)+ '%';
    			} else {
    				obj['unit'] = item[1];
    				obj['per'] = item[2] + '%';
    			}
    		};
    		data.push(obj);
    	};
    	console.log(JSON.stringify(data));
    }
})()